﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VersionComparer.DataModel
{
    public enum Difference
    {
        None = 0,
        Name = 1,
        Value = 2,
        ChildCount = 4,
        Unexistant = 8,
        AttributesCount = 16,
        NameCase = 32,
        ValueCase = 64,
        Unmatched = 256,
        TooManyErrors = 512,
        OutOfOrder = TooManyErrors* 2 
    }

    public static class DifferenceExtensions
    {
        public static string GetDescription(this Difference difference)
        {
            switch (difference)
            {
                case Difference.Name:
                    return Resources.Resources.NameDifferenceDescription;
                case Difference.NameCase:
                    return Resources.Resources.NameCaseDifferenceDescription;
                case Difference.OutOfOrder:
                    return Resources.Resources.OutOfOrderDifferenceDescription;
                case Difference.TooManyErrors:
                    return Resources.Resources.TooManyErrorsDifferenceDescription;
                case Difference.Unexistant:
                    return Resources.Resources.UnexistantDifferenceDescription;
                case Difference.Unmatched:
                    return Resources.Resources.UnmatchedDifferenceDescription;
                case Difference.Value:
                    return Resources.Resources.ValueDifferenceDescription;
                case Difference.ValueCase:
                    return Resources.Resources.ValueCaseDifferenceDescription;
            }
            return "";
        }
    }
}
